<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" type="text/css" href="/static/css/admin_console.css" />
    <title>Digital Content Wizard Admin Console</title>
  </head>
  <body>
    <br><br><br>
    <table>
      <td width=30%></td>
      <td class="borderedcontent">
        <div id="Main">
        <div  id="AllBooks" class="displayTable">
            <table class="admintable" cellpadding="0" cellspacing="0">
              <thead>
                <tr>
                  <td colspan="6"><span class="hd1">Admin Console</span></td>
                </tr>
                <tr class="heading">
                  <td width="1%"><span class="hd3">Version</span></td>
                  <td><span class="hd3">Preview</span></td>
                  <td width="10%"><span class="hd3">Publish</span></td>
                  <td width="10%"><span class="hd3">Delete</span></td>
                </tr>
              </thead>
              <tbody>
              <script type="text/javascript">
                var enc_versions = {{ encrypted_versions }};
                function ConfirmDelete(version) {
                  return confirm('Really delete version' + version + '?');
                }
              </script>
                {% for version in versions %}
                <tr>
                  <td>{{ version.plain }}</td>
                    <td>
                    <script type="text/javascript">
                      var enc_version = enc_versions.pop();
                      document.write('<a href="http://{{ base_url }}/' + enc_version + '/" target="_blank">http://{{ base_url }}/'+ enc_version + '/</a>');
                    </script>
                    </td>
                    {% ifequal version.plain published_version %}
                    <td><span class="status"><img border=0 src="/static/dcw-images/iLive.png" alt="Live"/> Live</span></td>
                    {% else %}
                    <script type="text/javascript">document.write('<td><span class="status"><a href="/confirm?version_id='+ enc_version + '">Publish</a></span></td>');</script>
                    {% endifequal %}
                    <script type="text/javascript">document.write('<td><a href="/delete?version_id=' + enc_version + '" onClick="ConfirmDelete({{ version.plain }});"><img border=0 src="/static/dcw-images/remove.png" alt="Delete this version"/></a></td>');</script>
                </tr>
                <tr class="colored">
                  {% if version.colored %}
                    <td>{{ version.colored }}</td>
                    <td>
                    <script type="text/javascript">
                      var enc_version = enc_versions.pop();
                      document.write('<a href="http://{{ base_url }}/' + enc_version + '/" target="_blank">http://{{ base_url }}/'+ enc_version + '/</a>');
                    </script>
                    </td>
                    {% ifequal version.colored published_version %}
                    <td><span class="status"><img border=0 src="/static/dcw-images/iLive.png" alt="Live"/> Live</span></td>
                    {% else %}
                    <script type="text/javascript">document.write('<td><span class="status"><a href="/confirm?version_id='+ enc_version + '">Publish</a></span></td>');</script>
                    {% endifequal %}
                    <script type="text/javascript">document.write('<td><a href="/delete?version_id=' + enc_version + '" onClick="ConfirmDelete({{ version.colored }});"><img border=0 src="/static/dcw-images/remove.png" alt="Delete this version"/></a></td>');</script>
                  {% endif %}
                </tr>
                {% endfor %}
              </tbody>
              <tfoot>
                <tr class="saveChanges">
                  <form method="post" action="/create?status=0">
                  <td colspan="5" class="borderedform">
                    <input type="submit" value="Create New Version">
                  </td>
                  </form>
                </tr>
              </tfoot>
            </table>
        </div>
        </div>
      </td>
      <td width=30%></td>
    </table>
  </body>
</html>
